Replication Data for "Returns to Political Contributions in Local Housing Markets"
Rui Yu; ruiyu.ch@gmail.com; Amazon

*************************
Software Environment
*************************

- MacOS 14.5 (23F79); Apple M3
- Stata/MP 14.2 for Mac (64-bit Intel)
- Stata Packages:
	- rdrobust version 9.2.0  2023-11-03
	- tabout Version 3.0.9 beta Ian Watson 17apr2019
	- reghdfe version 6.12.3 08aug2023

*************************
How to Run
*************************

- ./code/run-all.do is the script to replicate all tables and figures in the main body of the paper.
	- Under the "main" program are commands to subprograms.
	- Each subprogram generates a single table or figure in the main body of the paper.

*************************
Data Description
*************************

- contribution-election-mayor.dta
	- dataset of campaign contributions to the winner and runner-up in each mayoral election.
- donor-election_developer-rd.dta
	- dataset describing, for each developer in a mayoral election, the candidate they donated to, their donation amount, and the subsequent units and value of new housing they built in that city after the election.
- election_rd.dta
	- dataset describing, for each mayoral election, the winning candidate, the runner-up, the margin of victory, and whether the mayor received more campaign contributions from developers.
- zip-election-year-did.dta
	- stacked panel dataset of zip codes and years before and after a mayoral election. The key variables include whether a connected developer built in that zip code and the units of new housing sold in that zip.

*************************
Proprietary Data Description
*************************

- I use two proprietary datasets:
	- CoreLogic: I use Deeds database from CoreLogic, as described in the data section of the paper. The CoreLogic deed–tax data are processed to construct seller-level panels of new-home sales activity. Raw transaction records are first standardized by cleaning geographic identifiers and correcting and formatting sale and recording dates, which are then used to define transaction timing. Construction year information is cleaned of implausible values and imputed within parcels where missing, while location fields are harmonized to ensure consistent state and city identifiers. The sample is restricted to arms-length transactions by excluding foreclosures, refinances, equity lines of credit, and resales, and observations with missing key identifiers or timing information are dropped. Transactions are then deduplicated to retain only the first sale of new homes at the parcel level, accounting for identifier inconsistencies in later years. Finally, transaction-level data are aggregated to seller–ZIP–year and seller–city–year panels, separately tracking residential and non-residential sales values, unit counts, and buildings constructed.

	- CoStar: I use sales of new commercial real estate from CoStar, as described in the data section of the paper. The CoStar sales data are processed to construct seller-level panels of property sales activity. Transaction timing is standardized by formatting sale, recording, and publication dates and assigning the transaction year from the first available date. The sample is restricted to arms-length, completed sales based on sale status and research quality indicators. Properties with multiple sub-units are identified and separated to distinguish sales of distinct units within the same property, after which only the first observed sale per unit is retained. Price, unit count, and building variables are cleaned and constructed, seller and location identifiers are standardized, and transactions with missing key fields are dropped. Finally, sales are classified into residential and non-residential categories based on property type and aggregated to seller–ZIP–year and seller–city–year panels capturing total sales value, units sold, and buildings sold.


*************************
Output Description
*************************

- All outputs successfully run and log saved to ./output/run-all.log
- ./output/tables contains the the tex outputs of all tables.
- ./output/figures contains the the PDF outputs of all figures.